3.4.46 \(\int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx\) [346]

3.4.46.1 Optimal result
3.4.46.2 Mathematica [A] (verified)
3.4.46.3 Rubi [A] (verified)
3.4.46.4 Maple [A] (verified)
3.4.46.5 Fricas [A] (verification not implemented)
3.4.46.6 Sympy [F]
3.4.46.7 Maxima [F(-2)]
3.4.46.8 Giac [A] (verification not implemented)
3.4.46.9 Mupad [B] (verification not implemented)

3.4.46.1 Optimal result

Integrand size = 23, antiderivative size = 86 \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\frac {a x}{b^2}-\frac {2 \sqrt {a-b} \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d}-\frac {a \tan (c+d x)}{b d (b+a \sec (c+d x))} \]

output
a*x/b^2-2*arctan((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))*(a-b)^(1/2)*( 
a+b)^(1/2)/b^2/d-a*tan(d*x+c)/b/d/(b+a*sec(d*x+c))
 
3.4.46.2 Mathematica [A] (verified)

Time = 0.87 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.13 \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\frac {2 \sqrt {-a^2+b^2} \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )+\frac {a (a c+a d x+b (c+d x) \cos (c+d x)-b \sin (c+d x))}{a+b \cos (c+d x)}}{b^2 d} \]

input
Integrate[(a + b*Sec[c + d*x])/(b + a*Sec[c + d*x])^2,x]
 
output
(2*Sqrt[-a^2 + b^2]*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[-a^2 + b^2]] 
+ (a*(a*c + a*d*x + b*(c + d*x)*Cos[c + d*x] - b*Sin[c + d*x]))/(a + b*Cos 
[c + d*x]))/(b^2*d)
 
3.4.46.3 Rubi [A] (verified)

Time = 0.66 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.42, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.391, Rules used = {3042, 4411, 3042, 4407, 3042, 4318, 3042, 3138, 218}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {a+b \sec (c+d x)}{(a \sec (c+d x)+b)^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {a+b \csc \left (c+d x+\frac {\pi }{2}\right )}{\left (a \csc \left (c+d x+\frac {\pi }{2}\right )+b\right )^2}dx\)

\(\Big \downarrow \) 4411

\(\displaystyle \frac {\int \frac {a \left (a^2-b^2\right )+b \sec (c+d x) \left (a^2-b^2\right )}{b+a \sec (c+d x)}dx}{b \left (a^2-b^2\right )}-\frac {a \tan (c+d x)}{b d (a \sec (c+d x)+b)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {a \left (a^2-b^2\right )+b \csc \left (c+d x+\frac {\pi }{2}\right ) \left (a^2-b^2\right )}{b+a \csc \left (c+d x+\frac {\pi }{2}\right )}dx}{b \left (a^2-b^2\right )}-\frac {a \tan (c+d x)}{b d (a \sec (c+d x)+b)}\)

\(\Big \downarrow \) 4407

\(\displaystyle \frac {\frac {a x \left (a^2-b^2\right )}{b}-\frac {\left (a^2-b^2\right )^2 \int \frac {\sec (c+d x)}{b+a \sec (c+d x)}dx}{b}}{b \left (a^2-b^2\right )}-\frac {a \tan (c+d x)}{b d (a \sec (c+d x)+b)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {a x \left (a^2-b^2\right )}{b}-\frac {\left (a^2-b^2\right )^2 \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )}{b+a \csc \left (c+d x+\frac {\pi }{2}\right )}dx}{b}}{b \left (a^2-b^2\right )}-\frac {a \tan (c+d x)}{b d (a \sec (c+d x)+b)}\)

\(\Big \downarrow \) 4318

\(\displaystyle \frac {\frac {a x \left (a^2-b^2\right )}{b}-\frac {\left (a^2-b^2\right )^2 \int \frac {1}{\frac {b \cos (c+d x)}{a}+1}dx}{a b}}{b \left (a^2-b^2\right )}-\frac {a \tan (c+d x)}{b d (a \sec (c+d x)+b)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {a x \left (a^2-b^2\right )}{b}-\frac {\left (a^2-b^2\right )^2 \int \frac {1}{\frac {b \sin \left (c+d x+\frac {\pi }{2}\right )}{a}+1}dx}{a b}}{b \left (a^2-b^2\right )}-\frac {a \tan (c+d x)}{b d (a \sec (c+d x)+b)}\)

\(\Big \downarrow \) 3138

\(\displaystyle \frac {\frac {a x \left (a^2-b^2\right )}{b}-\frac {2 \left (a^2-b^2\right )^2 \int \frac {1}{\frac {(a-b) \tan ^2\left (\frac {1}{2} (c+d x)\right )}{a}+\frac {a+b}{a}}d\tan \left (\frac {1}{2} (c+d x)\right )}{a b d}}{b \left (a^2-b^2\right )}-\frac {a \tan (c+d x)}{b d (a \sec (c+d x)+b)}\)

\(\Big \downarrow \) 218

\(\displaystyle \frac {\frac {a x \left (a^2-b^2\right )}{b}-\frac {2 \left (a^2-b^2\right )^2 \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b d \sqrt {a-b} \sqrt {a+b}}}{b \left (a^2-b^2\right )}-\frac {a \tan (c+d x)}{b d (a \sec (c+d x)+b)}\)

input
Int[(a + b*Sec[c + d*x])/(b + a*Sec[c + d*x])^2,x]
 
output
((a*(a^2 - b^2)*x)/b - (2*(a^2 - b^2)^2*ArcTan[(Sqrt[a - b]*Tan[(c + d*x)/ 
2])/Sqrt[a + b]])/(Sqrt[a - b]*b*Sqrt[a + b]*d))/(b*(a^2 - b^2)) - (a*Tan[ 
c + d*x])/(b*d*(b + a*Sec[c + d*x]))
 

3.4.46.3.1 Defintions of rubi rules used

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3138
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ 
e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d)   Subst[Int[1/(a + b + 
(a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] 
 && NeQ[a^2 - b^2, 0]
 

rule 4318
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbo 
l] :> Simp[1/b   Int[1/(1 + (a/b)*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, 
f}, x] && NeQ[a^2 - b^2, 0]
 

rule 4407
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
 (a_)), x_Symbol] :> Simp[c*(x/a), x] - Simp[(b*c - a*d)/a   Int[Csc[e + f* 
x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c 
- a*d, 0]
 

rule 4411
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d 
_.) + (c_)), x_Symbol] :> Simp[b*(b*c - a*d)*Cot[e + f*x]*((a + b*Csc[e + f 
*x])^(m + 1)/(a*f*(m + 1)*(a^2 - b^2))), x] + Simp[1/(a*(m + 1)*(a^2 - b^2) 
)   Int[(a + b*Csc[e + f*x])^(m + 1)*Simp[c*(a^2 - b^2)*(m + 1) - (a*(b*c - 
 a*d)*(m + 1))*Csc[e + f*x] + b*(b*c - a*d)*(m + 2)*Csc[e + f*x]^2, x], x], 
 x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && LtQ[m, -1] && N 
eQ[a^2 - b^2, 0] && IntegerQ[2*m]
 
3.4.46.4 Maple [A] (verified)

Time = 0.82 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.40

method result size
derivativedivides \(\frac {\frac {2 a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}}-\frac {2 \left (\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b +a +b}+\frac {\left (a^{2}-b^{2}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{2}}}{d}\) \(120\)
default \(\frac {\frac {2 a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}}-\frac {2 \left (\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b +a +b}+\frac {\left (a^{2}-b^{2}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{2}}}{d}\) \(120\)
risch \(\frac {a x}{b^{2}}-\frac {2 i a \left ({\mathrm e}^{i \left (d x +c \right )} a +b \right )}{d \,b^{2} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 \,{\mathrm e}^{i \left (d x +c \right )} a +b \right )}+\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {-a^{2}+b^{2}}+a}{b}\right )}{d \,b^{2}}-\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \sqrt {-a^{2}+b^{2}}-a}{b}\right )}{d \,b^{2}}\) \(160\)

input
int((a+b*sec(d*x+c))/(b+a*sec(d*x+c))^2,x,method=_RETURNVERBOSE)
 
output
1/d*(2*a/b^2*arctan(tan(1/2*d*x+1/2*c))-2/b^2*(a*b*tan(1/2*d*x+1/2*c)/(tan 
(1/2*d*x+1/2*c)^2*a-tan(1/2*d*x+1/2*c)^2*b+a+b)+(a^2-b^2)/((a-b)*(a+b))^(1 
/2)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a-b)*(a+b))^(1/2))))
 
3.4.46.5 Fricas [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 279, normalized size of antiderivative = 3.24 \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\left [\frac {2 \, a b d x \cos \left (d x + c\right ) + 2 \, a^{2} d x - 2 \, a b \sin \left (d x + c\right ) + \sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right )}{2 \, {\left (b^{3} d \cos \left (d x + c\right ) + a b^{2} d\right )}}, \frac {a b d x \cos \left (d x + c\right ) + a^{2} d x - a b \sin \left (d x + c\right ) - \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right )}{b^{3} d \cos \left (d x + c\right ) + a b^{2} d}\right ] \]

input
integrate((a+b*sec(d*x+c))/(b+a*sec(d*x+c))^2,x, algorithm="fricas")
 
output
[1/2*(2*a*b*d*x*cos(d*x + c) + 2*a^2*d*x - 2*a*b*sin(d*x + c) + sqrt(-a^2 
+ b^2)*(b*cos(d*x + c) + a)*log((2*a*b*cos(d*x + c) + (2*a^2 - b^2)*cos(d* 
x + c)^2 + 2*sqrt(-a^2 + b^2)*(a*cos(d*x + c) + b)*sin(d*x + c) - a^2 + 2* 
b^2)/(b^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + a^2)))/(b^3*d*cos(d*x + c) 
 + a*b^2*d), (a*b*d*x*cos(d*x + c) + a^2*d*x - a*b*sin(d*x + c) - sqrt(a^2 
 - b^2)*(b*cos(d*x + c) + a)*arctan(-(a*cos(d*x + c) + b)/(sqrt(a^2 - b^2) 
*sin(d*x + c))))/(b^3*d*cos(d*x + c) + a*b^2*d)]
 
3.4.46.6 Sympy [F]

\[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\int \frac {a + b \sec {\left (c + d x \right )}}{\left (a \sec {\left (c + d x \right )} + b\right )^{2}}\, dx \]

input
integrate((a+b*sec(d*x+c))/(b+a*sec(d*x+c))**2,x)
 
output
Integral((a + b*sec(c + d*x))/(a*sec(c + d*x) + b)**2, x)
 
3.4.46.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]

input
integrate((a+b*sec(d*x+c))/(b+a*sec(d*x+c))^2,x, algorithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f 
or more de
 
3.4.46.8 Giac [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.62 \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\frac {\frac {{\left (d x + c\right )} a}{b^{2}} - \frac {2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b\right )} b} - \frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} \sqrt {a^{2} - b^{2}}}{b^{2}}}{d} \]

input
integrate((a+b*sec(d*x+c))/(b+a*sec(d*x+c))^2,x, algorithm="giac")
 
output
((d*x + c)*a/b^2 - 2*a*tan(1/2*d*x + 1/2*c)/((a*tan(1/2*d*x + 1/2*c)^2 - b 
*tan(1/2*d*x + 1/2*c)^2 + a + b)*b) - 2*(pi*floor(1/2*(d*x + c)/pi + 1/2)* 
sgn(2*a - 2*b) + arctan((a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/ 
sqrt(a^2 - b^2)))*sqrt(a^2 - b^2)/b^2)/d
 
3.4.46.9 Mupad [B] (verification not implemented)

Time = 14.98 (sec) , antiderivative size = 444, normalized size of antiderivative = 5.16 \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\frac {2\,\mathrm {atanh}\left (\frac {64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{64\,a^4-128\,a^3\,b+128\,a\,b^3-64\,b^4}-\frac {192\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{128\,a\,b^2-128\,a^3-64\,b^3+\frac {64\,a^4}{b}}+\frac {192\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{128\,a\,b-64\,b^2-\frac {128\,a^3}{b}+\frac {64\,a^4}{b^2}}-\frac {64\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{128\,a\,b-64\,b^2-\frac {128\,a^3}{b}+\frac {64\,a^4}{b^2}}\right )\,\sqrt {b^2-a^2}}{b^2\,d}-\frac {2\,a\,\mathrm {atan}\left (\frac {64\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a\,b-64\,a^2-\frac {64\,a^3}{b}+\frac {64\,a^4}{b^2}}+\frac {64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a\,b^2-64\,a^2\,b-64\,a^3+\frac {64\,a^4}{b}}-\frac {64\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^4-64\,a^3\,b-64\,a^2\,b^2+64\,a\,b^3}-\frac {64\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a\,b-64\,a^2-\frac {64\,a^3}{b}+\frac {64\,a^4}{b^2}}\right )}{b^2\,d}-\frac {2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b\,d\,\left (\left (a-b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a+b\right )} \]

input
int((a + b/cos(c + d*x))/(b + a/cos(c + d*x))^2,x)
 
output
(2*atanh((64*a^3*tan(c/2 + (d*x)/2)*(b^2 - a^2)^(1/2))/(128*a*b^3 - 128*a^ 
3*b + 64*a^4 - 64*b^4) - (192*a^2*tan(c/2 + (d*x)/2)*(b^2 - a^2)^(1/2))/(1 
28*a*b^2 - 128*a^3 - 64*b^3 + (64*a^4)/b) + (192*a*tan(c/2 + (d*x)/2)*(b^2 
 - a^2)^(1/2))/(128*a*b - 64*b^2 - (128*a^3)/b + (64*a^4)/b^2) - (64*b*tan 
(c/2 + (d*x)/2)*(b^2 - a^2)^(1/2))/(128*a*b - 64*b^2 - (128*a^3)/b + (64*a 
^4)/b^2))*(b^2 - a^2)^(1/2))/(b^2*d) - (2*a*atan((64*a^2*tan(c/2 + (d*x)/2 
))/(64*a*b - 64*a^2 - (64*a^3)/b + (64*a^4)/b^2) + (64*a^3*tan(c/2 + (d*x) 
/2))/(64*a*b^2 - 64*a^2*b - 64*a^3 + (64*a^4)/b) - (64*a^4*tan(c/2 + (d*x) 
/2))/(64*a*b^3 - 64*a^3*b + 64*a^4 - 64*a^2*b^2) - (64*a*b*tan(c/2 + (d*x) 
/2))/(64*a*b - 64*a^2 - (64*a^3)/b + (64*a^4)/b^2)))/(b^2*d) - (2*a*tan(c/ 
2 + (d*x)/2))/(b*d*(a + b + tan(c/2 + (d*x)/2)^2*(a - b)))